<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>

</html>
<script>
    // js字符串排列组合
    function perm(str) {
        var result = [];
        if (str.length <= 1) {
            return [str];
        } else {
            for (var i = 0; i < str.length; i++) {
                var c = str[i];
                var newStr = str.slice(0, i) + str.slice(i + 1, str.length);
                var l = perm(newStr);
                for (var j = 0; j < l.length; j++) {
                    var tmp = c + l[j];
                    result.push(tmp);
                }
            }
        }
        return result;
    }
</script>